package com.by.controller;

import com.by.bean.ProductCategory;
import com.by.common.bean.ResultBean;
import com.by.common.controller.BaseController;
import com.by.service.ProductCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "产品分类")
@RestController
@RequestMapping("/api")
@CrossOrigin
public class ProductCategorySController extends BaseController {

    @Autowired
    ProductCategoryService productCategoryService;

    @ApiOperation("保存类别")
    @PostMapping("/product/category")
    public ResultBean save(@RequestBody ProductCategory productCategory) {
        int rs = productCategoryService.save(productCategory);
        return saveResult(rs);
    }
}
